import React, { useEffect } from 'react'
import { View, Image, Swiper, SwiperItem, Text } from '@tarojs/components'

import './index.less'
import "taro-ui/dist/style/components/list.scss";
import "taro-ui/dist/style/components/countdown.scss";
import "taro-ui/dist/style/components/tag.scss";

export default (props: any) => {
  const { src,title } = props.data
  const { telType,price } = props
  const imgList = src ? src.split('&') : []
  useEffect(() => {
  }, [])
  return (
    <View className='topInfo'>
      {
        // <View className="tel">您选择的服务商为：{telType === 1 ? '中国移动' : telType === 2 ? '中国联通' : '中国电信'}</View> : <Vi</View>ew>
        telType > 0 ? <View className="tel">校园网服务平台</View> : <View>
          <Swiper
          className='swiper'
          indicatorColor='#999'
          indicatorActiveColor='#333'
          circular
          indicatorDots
          autoplay>
          {
            imgList.map((item, i) => (
              <SwiperItem key={i}>
                <Image className='banner' src={item}></Image>
              </SwiperItem>
            ))
          }
        </Swiper>
          <View className='price'>
              <View className='p1'>￥{price}</View>
              <View className='p2'>{title}</View>
          </View>
        </View>
      }
    </View>
  )
}
